<!DOCTYPE html>
<html lang="zh-CN">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>档案管理 - 图片详情</title>
<!--[if lt IE 9]>
<script src="libs/html5shiv.min.js"></script>
<script src="libs/respond.min.js"></script>
<![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script src="libs/handlebars.min.js"></script>
<script src="libs/js.cookie-2.1.0.min.js"></script>
<script src="libs/getQueryString.js"></script>
<script src="libs/jquery.backstretch.min.js"></script>
<script src="libs/md5.min.js"></script>
<script src="libs/jquery.backstretch.min.js"></script>
</head>
<body>
	
	<div class="container">
		<div class="row">
			<div class="page-header">
				<h2 class="text-center">
					档案管理<br /> <small>图片详情</small>
				</h2>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-6">
				<ul class="nav nav-pills pull-right">
					<li><a href="#">用户：<span id="text1"></span></a></li>
					<li><a href="index.html">首页</a></li>
					<li><a href="add.html">添加</a></li>

					<li><a href="count.html">统计</a></li>

					<li><a href="query.html">查询</a></li>
					<li class="active"><a href="#">图片详情</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<hr />
		</div>
	</div>
	<div class="container">
		<div class="row">
			
			<div class="col-md-12 col-md-offset-1">
			  <div class="container">
				 <div >
				 
            		<p>
					  <img id="pic" src="" width="200" height="200" />
		   			</p>
		   			<div class="col-md-2">
					   <button id="delete" class="btn btn-default btn-block">删除</button>
				    </div>
         		 	<div class="panel-body" ><span id="text1"></span></div>
       			 
       			 </div>
			  </div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$(function() {
			var id = getQueryString('id');
			$.backstretch("photo/index.jpg");
			$.getJSON('PhotoDes.action?id=' + id, function(res) {
				$('#text1').text(res[0].archive_id);
				   console.log(res);
				   $('#pic').attr('src', 'upload/' + res[0].archive_id + '/' + res[0].name);
			  });
			
			 $('#delete').click(function () {
				  $.post('delFile.action?id=' + id, {  
					  id: id
				  }, function (res, status) {
					  //加IF判断是否删除
					if ('OK' == res) {
		          		alert('删除成功');
		         		window.location.href='index.html'
					 }
				  })
			  }); 
			  
			  $.getJSON('querynickname.action', function(res) {
					console.log(res);
					$('#text1').text(res[0].nickname);
			});
		});
	</script>

</body>
</html>